package com.baorant.resouceserverapplication;

import com.baorant.resouceserverapplication.utils.HttpClientWithBasicAuth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;

import java.util.HashMap;
import java.util.Map;

@EnableResourceServer
@SpringBootApplication
public class ResouceServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(ResouceServerApplication.class, args);
        String url = "http://192.168.56.101:3333/oauth/token";
        Map<String, String> formData = new HashMap<String, String>();
        formData.put("grant_type", "client_credentials");
        formData.put("grant", "all");
        String result = new HttpClientWithBasicAuth().send(url, "test", "123456", formData);
        System.out.println(result);
    }
}
